import request from '@/utils/request'

var myurl = '/drug/recipt';

// 查询单据具体信息列表
export function listPhysic(query) {
  return request({
    url: myurl + '/list',
    method: 'get',
    params: query
  })
}

// 获取登录用户姓名‘
export function getUserName() {
  return request({
    url: myurl + '/getUserName',
    method: 'get'
  })
}

//查询供应商列表
export function listSupplier() {
  return request({
    url: myurl + '/listSupplier',
    method: 'get'
  })
}


//获取药品信息
export function listStore(query) {
  return request({
    url: myurl + '/listStore',
    method: 'get',
    params: query
  })
}


// 修改药品信息
export function addReciptPhysic(ids,data) {
  return request({
    url: myurl +'/'+ids,
    method: 'put',
    data: data
  })
}

//暂存
export function addRecipt1(data) {
  return request({
    url: myurl + '/transient',
    method: 'post',
    data: data
  })
}

//提交审核
export function addRecipt2(data) {
  return request({
    url: myurl + '/process',
    method: 'post',
    data: data
  })
}

// 删除公告
export function delPhysicById(physicId) {
  return request({
    url: myurl + '/physic/' + physicId,
    method: 'delete'
  })
}

// 查询单据
export function listRecipt(query) {
  return request({
    url: myurl + '/listRecipt',
    method: 'get',
    params: query
  })
}

//批量设置
export function updateSetting(ids,data) {
  return request({
    url: myurl +'/setting/'+ids,
    method: 'put',
    data: data
  })
}

//单据作废
export function delrecipt(ids) {
  return request({
    url: myurl + '/delRecipt/' + ids,
    method: 'put'
  })
}
//批量审核
export function updateRecipt3(ids) {
  return request({
    url: myurl + '/processRecipt/' + ids,
    method: 'put'
  })
}

//药品入库
export function reciptPutIn(ids) {
  return request({
    url: myurl + '/reciptPutIn/' + ids,
    method: 'put'
  })
}

//查询当前订单状态
export function selectReciptByNum(query) {
  return request({
    url: myurl + '/selectReciptByNum',
    method: 'get',
    params: query
  })
}
